//
//  ParkingNumController.m
//  PropertyMananger
//
//  Created by bh on 17/1/4.
//  Copyright © 2017年 BH. All rights reserved.
//

#import "ParkingNumController.h"
#import "ParkingNumCell.h"


@interface ParkingNumController ()<UISearchBarDelegate>
/**数据源**/
@property (nonatomic,strong) NSArray * infoArray;
@property (nonatomic,strong) NSArray * titleArray;
@property (nonatomic,strong) NSArray * iconArray;

@end

@implementation ParkingNumController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    [self initTitleViewName:@"车位编号查询详情"];
   
    
    [self initTableViewWithView:self.view frame:CGRectMake(0, 0, BHscreenW, BHscreenH - 20) isGroup:NO];
    self.tableView.backgroundColor = BHColor(238, 238, 238);
    
    [self getParkingData];
}
#pragma mark - 数据源
- (void)getParkingData
{
    //icon
    self.iconArray = @[@"ico_parking_lot_state",@"ico_parking_lot_name",@"ico_parking_lot_phone",@"ico_parking_lot_number",@"ico_parking_lot_home",@"ico_parking_lot_start_time",@"ico_parking_lot_end_time"];
    //标题
    self.titleArray = @[@"车位当前状态",@"车主姓名",@"车主电话",@"车牌号",@"车位编号",@"合同开始时间",@"合同结束时间"];

}
#pragma mark - 搜索框

#pragma mark - tableview代理方法
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.iconArray.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    ParkingNumCell * parkCell= [ParkingNumCell cellWithTableView:tableView];
    parkCell.imgView.image = IMG(self.iconArray[indexPath.row]);
    parkCell.titleLabel.text = self.titleArray[indexPath.row];

    if (indexPath.row == 0) {
        
        parkCell.infoLabel.textColor = Theme_Color;
        parkCell.infoLabel.text = self.model.ParkStatus;
        
    }else if (indexPath.row == 1){
    parkCell.infoLabel.text = self.model.Name;
    }else if (indexPath.row == 2){
     parkCell.infoLabel.text = self.model.Phone;
    }else if (indexPath.row == 3){
     parkCell.infoLabel.text = self.model.CarNo;
    }else if (indexPath.row == 4){
    parkCell.infoLabel.text = self.model.ParkingCode;
    }else if (indexPath.row == 5){
    parkCell.infoLabel.text = self.model.StartTime;
    }else if (indexPath.row == 6){
    parkCell.infoLabel.text = self.model.EndTime;
    }
    return parkCell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 50;
}
@end
